{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport DecadeHeader from \"./DecadeHeader\";\nimport DecadeBody, { DECADE_COL_COUNT } from \"./DecadeBody\";\nimport { createKeyDownHandler } from \"../../utils/uiUtil\";\nexport var DECADE_UNIT_DIFF = 10;\nexport var DECADE_DISTANCE_COUNT = DECADE_UNIT_DIFF * 10;\nfunction DecadePanel(props) {\n  var prefixCls = props.prefixCls,\n    onViewDateChange = props.onViewDateChange,\n    generateConfig = props.generateConfig,\n    viewDate = props.viewDate,\n    operationRef = props.operationRef,\n    onSelect = props.onSelect,\n    onPanelChange = props.onPanelChange;\n  var panelPrefixCls = \"\".concat(prefixCls, \"-decade-panel\"); // ======================= Keyboard =======================\n\n  operationRef.current = {\n    onKeyDown: function onKeyDown(event) {\n      return createKeyDownHandler(event, {\n        onLeftRight: function onLeftRight(diff) {\n          onSelect(generateConfig.addYear(viewDate, diff * DECADE_UNIT_DIFF), 'key');\n        },\n        onCtrlLeftRight: function onCtrlLeftRight(diff) {\n          onSelect(generateConfig.addYear(viewDate, diff * DECADE_DISTANCE_COUNT), 'key');\n        },\n        onUpDown: function onUpDown(diff) {\n          onSelect(generateConfig.addYear(viewDate, diff * DECADE_UNIT_DIFF * DECADE_COL_COUNT), 'key');\n        },\n        onEnter: function onEnter() {\n          onPanelChange('year', viewDate);\n        }\n      });\n    }\n  }; // ==================== View Operation ====================\n\n  var onDecadesChange = function onDecadesChange(diff) {\n    var newDate = generateConfig.addYear(viewDate, diff * DECADE_DISTANCE_COUNT);\n    onViewDateChange(newDate);\n    onPanelChange(null, newDate);\n  };\n  var onInternalSelect = function onInternalSelect(date) {\n    onSelect(date, 'mouse');\n    onPanelChange('year', date);\n  };\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: panelPrefixCls\n  }, /*#__PURE__*/React.createElement(DecadeHeader, _extends({}, props, {\n    prefixCls: prefixCls,\n    onPrevDecades: function onPrevDecades() {\n      onDecadesChange(-1);\n    },\n    onNextDecades: function onNextDecades() {\n      onDecadesChange(1);\n    }\n  })), /*#__PURE__*/React.createElement(DecadeBody, _extends({}, props, {\n    prefixCls: prefixCls,\n    onSelect: onInternalSelect\n  })));\n}\nexport default DecadePanel;","map":{"version":3,"names":["_extends","React","DecadeHeader","DecadeBody","DECADE_COL_COUNT","createKeyDownHandler","DECADE_UNIT_DIFF","DECADE_DISTANCE_COUNT","DecadePanel","props","prefixCls","onViewDateChange","generateConfig","viewDate","operationRef","onSelect","onPanelChange","panelPrefixCls","concat","current","onKeyDown","event","onLeftRight","diff","addYear","onCtrlLeftRight","onUpDown","onEnter","onDecadesChange","newDate","onInternalSelect","date","createElement","className","onPrevDecades","onNextDecades"],"sources":["/data/messenger.client/node_modules/rc-picker/es/panels/DecadePanel/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport DecadeHeader from \"./DecadeHeader\";\nimport DecadeBody, { DECADE_COL_COUNT } from \"./DecadeBody\";\nimport { createKeyDownHandler } from \"../../utils/uiUtil\";\nexport var DECADE_UNIT_DIFF = 10;\nexport var DECADE_DISTANCE_COUNT = DECADE_UNIT_DIFF * 10;\n\nfunction DecadePanel(props) {\n  var prefixCls = props.prefixCls,\n      onViewDateChange = props.onViewDateChange,\n      generateConfig = props.generateConfig,\n      viewDate = props.viewDate,\n      operationRef = props.operationRef,\n      onSelect = props.onSelect,\n      onPanelChange = props.onPanelChange;\n  var panelPrefixCls = \"\".concat(prefixCls, \"-decade-panel\"); // ======================= Keyboard =======================\n\n  operationRef.current = {\n    onKeyDown: function onKeyDown(event) {\n      return createKeyDownHandler(event, {\n        onLeftRight: function onLeftRight(diff) {\n          onSelect(generateConfig.addYear(viewDate, diff * DECADE_UNIT_DIFF), 'key');\n        },\n        onCtrlLeftRight: function onCtrlLeftRight(diff) {\n          onSelect(generateConfig.addYear(viewDate, diff * DECADE_DISTANCE_COUNT), 'key');\n        },\n        onUpDown: function onUpDown(diff) {\n          onSelect(generateConfig.addYear(viewDate, diff * DECADE_UNIT_DIFF * DECADE_COL_COUNT), 'key');\n        },\n        onEnter: function onEnter() {\n          onPanelChange('year', viewDate);\n        }\n      });\n    }\n  }; // ==================== View Operation ====================\n\n  var onDecadesChange = function onDecadesChange(diff) {\n    var newDate = generateConfig.addYear(viewDate, diff * DECADE_DISTANCE_COUNT);\n    onViewDateChange(newDate);\n    onPanelChange(null, newDate);\n  };\n\n  var onInternalSelect = function onInternalSelect(date) {\n    onSelect(date, 'mouse');\n    onPanelChange('year', date);\n  };\n\n  return /*#__PURE__*/React.createElement(\"div\", {\n    className: panelPrefixCls\n  }, /*#__PURE__*/React.createElement(DecadeHeader, _extends({}, props, {\n    prefixCls: prefixCls,\n    onPrevDecades: function onPrevDecades() {\n      onDecadesChange(-1);\n    },\n    onNextDecades: function onNextDecades() {\n      onDecadesChange(1);\n    }\n  })), /*#__PURE__*/React.createElement(DecadeBody, _extends({}, props, {\n    prefixCls: prefixCls,\n    onSelect: onInternalSelect\n  })));\n}\n\nexport default DecadePanel;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,YAAY,MAAM,gBAAgB;AACzC,OAAOC,UAAU,IAAIC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,oBAAoB,QAAQ,oBAAoB;AACzD,OAAO,IAAIC,gBAAgB,GAAG,EAAE;AAChC,OAAO,IAAIC,qBAAqB,GAAGD,gBAAgB,GAAG,EAAE;AAExD,SAASE,WAAW,CAACC,KAAK,EAAE;EAC1B,IAAIC,SAAS,GAAGD,KAAK,CAACC,SAAS;IAC3BC,gBAAgB,GAAGF,KAAK,CAACE,gBAAgB;IACzCC,cAAc,GAAGH,KAAK,CAACG,cAAc;IACrCC,QAAQ,GAAGJ,KAAK,CAACI,QAAQ;IACzBC,YAAY,GAAGL,KAAK,CAACK,YAAY;IACjCC,QAAQ,GAAGN,KAAK,CAACM,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